import request from '@/utils/request'

export function find(data) {
  return request({
    url: '/v1/rep/find',
    method: 'get',
    params: {
      type: data.type,
      status: data.status,
      projectId: data.projectId
    }
  })
}

export function add(data) {
  return request({
    url: '/v1/rep/add',
    method: 'post',
    data: {
      address: data.address,
      projectIds: data.choseMember,
      type: data.respType
    }
  })
}

export function edit(data) {
  return request({
    url: '/v1/rep/edit',
    method: 'put',
    data: {
      crId: data.crId,
      address: data.address,
      projectIds: data.choseMember,
      type: data.respType
    }
  })
}

export function changeStatus(id) {
  return request({
    url: '/v1/rep/changeStatus/' + id,
    method: 'put'
  })
}

export function getSubmit(id) {
  return request({
    url: '/v1/rep/getSubmit',
    method: 'get',
    params: {
      crId: id
    }
  })
}

export function board(id) {
  return request({
    url: '/v1/rep/board/' + id,
    method: 'put'
  })
}
